﻿using System.Collections;

namespace IntoStationSystem.PLC
{
    public class PlcData

    {
        public int PageId;
        public int PageIdFeedBack;
        public int LocalModelId;
        public int ProduceModel;
        public int ProduceCount;
        public int OkCount;
        public int NgCount;
        public int BeatTime;
        public int RunTime;
        public string CraftId;
        public string PartId;
        public string AmendId;
        public BitArray SysBit = new BitArray(16);
        public BitArray SetButton = new BitArray(16);
        public BitArray PulseButton = new BitArray(16);
        public BitArray Manual = new BitArray(40);
        //安全
        public byte Security;
        //设备  编码说明：0、故障解除 1、设备发生故障；暂时预留
        public byte Equipment;
        //编码说明：0、物料OK 1、物料缺失 。暂时预留
        public byte Material;
        //编码说明：0、品质正常 1、品质异常。暂时预留
        public byte Quality;
        //编码说明：1、呼叫机修；2、呼叫电修；3、呼叫机电维修。暂时预留
        public byte Personnel;
        //配置设备运行状态，步骤提示2. 预留
        public int Step;
        //配置参数设置 
        public float[] SetParam = new float[16];
        //配置参数显示  
        public float[] ShowParam = new float[16];
        //暂时停用
        public int SetId;
        //暂时停用
        public int InPut;
        //暂时停用
        public int OutPut;
        //配置提示信息
        public BitArray Prompt = new BitArray(32);
        //配置提示信息
        public BitArray Waring = new BitArray(32);
        //配置提示信息
        public BitArray Alarm = new BitArray(128);
        public BitArray RfidWrite = new BitArray(8);
        public BitArray RfidRead = new BitArray(8);
        public byte RfidPartByte1;
        public byte RfidPartByte2;
        public byte RfidPartByte3;
        public byte RfidPartByte4;
        public byte[] LableByte = new byte[32];
        public byte[] RfidGroup1 = new byte[40];
        public byte[] RfidGroup2 = new byte[40];
        public Group[] Groups = new Group[7]
        {
            new Group(),
            new Group(),
            new Group(),
            new Group(),
            new Group(),
            new Group(),
            new Group(),
        };
        public int SetNumber;
        public int Number;
        public int Ratio;
        public int Inching;
        public int CurrentPOPU;
        public float CurrentPOMM;
        public int NewWarning;
        public int Fault;
        public BitArray ForwardBack = new BitArray(8);
        public BitArray State = new BitArray(8);
        public byte[] Collection = new byte[8];
        public byte[] Reads = new byte[16];
        public byte[] Writes = new byte[16];
        //采集的数据
        public float[] GetFloats = new float[64];
        public byte[] GetBytes = new byte[64];
    }

    public class Group
    {
        public BitArray Write = new BitArray(8);
        public BitArray Read = new BitArray(8);
        public byte[] Byte = new byte[4];
        public float[] SetReal = new float[8];
        public float[] ShowReal = new float[8];
    }
}
